import type { UnFileType } from '@uni-helper/uni-network'

interface UploadFileAPIData {
  tempFilePath: string
  fileType: UnFileType
}

export function uploadFileAPI(data: UploadFileAPIData, token: string) {
  return httpInstance.upload<string>({
    url: '/api/common/upload',
    name: 'file',
    filePath: data.tempFilePath,
    fileType: data.fileType,
    headers: { token },
  })
}
